<?php
/*
 * FQL Builder
 *
 * http://fql-builder.mariogarcia.biz
 *
 * Copyright (c) 2011 - 2012 Mario Garcia
 *
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
 
include_once '../lib/functions.php';

$fql_reference = unserialize(file_get_contents('fql-reference.serialize'));

foreach(array_keys($fql_reference) as $k=>$v){
  $_item = new stdClass();
  $_item->title = $v;
  $_item->key = "id_fb_table_{$v}";
  $__tables[]=$_item;
}

$item = new stdClass();
$item->title = 'tables';
$item->isFolder = 1;
$item->children = $__tables;

$tables[] =$item;

json_out($tables);    